<?php
$width=Yii::app()->params['dialog']['findTruckForToRepair']['width'];
$height=Yii::app()->params['dialog']['findTruckForToRepair']['height'];
$cs=Yii::app()->clientScript;
$cs->registerScriptFile('./js/modal.js');
$cs->registerScript('truck_repair_dialog',<<<END
function Block(){\$.modal('?r=dialog/findTruckForToRepair',{width:$width,height:$height,title:'请选择车辆/尾板'});return false;}
$("#findTruck").click(function(){Block();return false;});
END
)
?>
<div class="yiiForm">
<?php
	echo EHtml::form();	
	EHtml::setOptions(array('errorElement'=> 'span'));
	EHtml::setScenario($update ? 'update' : 'create');				  		
?>
<div style="padding:10px 110px">注：<span class="required">*</span>为必填项</div>
<div id="one1">
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'plate_no'); ?>
<?php echo EHtml::activeTextField($model,'plate_no',array('size'=>10,'class'=>'readonly','readOnly'=>'true')); ?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'reg_no'); ?>
<?php echo EHtml::activeTextField($model,'reg_no',array('size'=>18,'class'=>'readonly','readOnly'=>'true')); ?>&nbsp;&nbsp;<a id="findTruck" href="#">查找车辆/尾板</a>
</div>
<?php echo CHtml::activeHiddenField($model,'fk_truck_id');?>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'reporter'); ?>
<?php echo EHtml::activeTextField($model,'reporter',array('size'=>8,'maxlength'=>30)); ?>
</div>
<div class="simple5" style="background-color: #ffffff;">
<?php echo CHtml::activeLabelEx($model,'cause_of_accident'); ?>
<?php echo EHtml::activeTextArea($model,'cause_of_accident',array('rows'=>6, 'cols'=>45)); ?>
</div>
</div>
<div class="action">
<?php echo EHtml::submitButton($update ? '更新信息' : '添加信息'); ?>
</div>

<?php echo EHtml::endForm(); ?>

</div><!-- yiiForm -->
<?php 
if($model->hasErrors()) echo "<script>alert('您填写的信息有误！请根据页面红色图标提示修改。');</script>";
?>